<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;

/**
 * 示例接口
 */
class Feedback extends Api
{


    // 无需登录的接口,*表示全部
    protected $noNeedLogin = [''];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    public function submit(){

        $use=$this->auth->getUser();

        $user=Db::name('user')->where(['id'=>$use['id']])->find();

        $msg=$this->request->param('msg');
        $name=$this->request->param('name');


        $log['user_id']=$user['id'];
        $log['msg']=$msg;
        $log['name']=$name;
        $log['quyu_id']=$user['quyu_id'];
        $log['time']=time();

        Db::name('feedback')->data($log)->insert();

        $this->success('操作成功！');

    }



}